<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>2、 数组中有一个数字出现的次数超过数组长度的一半，请找出这个数</title>
</head>

<body>
  <script>
    let arr = [1, 2, 2, 3, 3, 2]
    // let sum = []
    function array(arr) {
      arr.sort((a, b) => a - b);
      return arr[Math.floor(arr.length / 2)]
    };
    console.log(array(arr))
  </script>
</body>

</html>